
import java.util.*;

public class Room 
{
    private String description;
    private Map<String, Room> exits = new HashMap<>();
    private Thing thing = null;
    private Monster monster = null;

    /**
     * Create a room described "description". Initially, it has
     * no exits. "description" is something like "a kitchen" or
     * "an open court yard".
     * @param description The room's description.
     */
    public Room(String description) 
    {
        this.description = description;
    }
    
    public Room(String description, Thing thing) {
        this(description);
        this.thing = thing;
    }
    
    public Room(String description, Monster monster) {
        this(description);
        this.monster = monster;
    }
    
    public Room(String description, Thing thing, Monster monster) {
        this(description, thing);
        this.monster = monster;
    }

    public void setExit(String direction, Room room) {
        exits.put(direction, room);
    }

    /**
     * @return The description of the room.
     */
    public String getDescription()
    {
        return description;
    }

    public void printExits() {
        System.out.print("Exits: ");
        for(String key : exits.keySet()) {
            System.out.print(key + " ");
        }
        System.out.println();
    }
    
    public Room goNext(String direction) {
        return exits.get(direction);
    }
    
    public Thing getThing() {
        return this.thing;
    }
    
    public Monster getMonster() {
        return this.monster;
    }
    
    public void remove() {
        this.thing = null;
    }
    
    public void removeMonster() {
        this.monster = null;
    }
}